<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象方法的简写形式</title>
  <script type="text/javascript">

    //传统方法
    let monster={name:"牛魔王",
                age:800,
                sayHi:function (){
                  console.log("信息=",this.name,this.age)
                }}

    monster.dss=function (){
        console.log("随便写的方法名")
    }
    monster.sayHi()
    monster.dss()

    //ES6对象方法定义
    let monster={name:"牛魔王",
      age:800,
      sayHi(){
        console.log("信息=",this.name,this.age)
      },
        f1(){
            console.log("f1()方法")
        }}
    monster.sayHi()
    monster.f1()

  </script>
</head>
<body>

</body>
</html>